package com.ysh.ioc.controller;

import com.ysh.ioc.model.DbTypes;
import com.ysh.ioc.model.Person;
import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

@Controller
public class YmlController {

    @Value("${my.key3}")
    private String myKey3;
    @Value("${my.key4}")
    private boolean myKey4;


    @Autowired
    private Person person1;
    @Autowired
    private Person person2;
    @Autowired
    private DbTypes dbTypes;


    @PostConstruct
    public void init(){

        System.out.println("myKey3:"+myKey3);
        System.out.println("myKey4:"+myKey4);
        System.out.println(person1);
        System.out.println(person2);
        System.out.println(dbTypes);
    }
}
